import axios from "../utils/request";

const base = {
  baseUrl: "http://localhost:3000/api",
  hot1: "/hot1",
  hot2: "/hot2",
  city: "/city",
  search: "/search",
  details: "/details",
  comment: "/comment",
  login: "/login",
  order: "/order",
};

const api = {
  hot1(params) {
    return axios.get(base.baseUrl + base.hot1, {
      params
    });
  },
  hot2() {
    return axios.get(base.baseUrl + base.hot2);
  },
  city() {
    return axios.get(base.baseUrl + base.city);
  },
  search(params) {
    console.log(params);
    return axios.get(base.baseUrl + base.search, {
      params,
    });
  },
  details(params) {
    return axios.get(base.baseUrl + base.details, {
      params,
    });
  },
  comment(params) {
    return axios.get(base.baseUrl + base.comment, {
      params,
    });
  },
  login(params) {
    return axios.post(base.baseUrl + base.login, params);
  },
  order(params) {
    return axios.get(base.baseUrl + base.order, {
      params,
    });
  },
};

export default api;